﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    public class Blog
    {
        /// <summary>
		/// blog_id
        /// </summary>
        public int blog_id { get; set; }
        /// <summary>
        /// blog_title
        /// </summary>
        public string blog_title { get; set; }
        /// <summary>
        /// blog_subtitle
        /// </summary>
        public string blog_subtitle { get; set; }
        /// <summary>
        /// blog_content
        /// </summary>
        public string blog_content { get; set; }
        /// <summary>
        /// blog_adminid
        /// </summary>
        public int blog_adminid { get; set; }
        /// <summary>
        /// blog_addtime
        /// </summary>
        public DateTime blog_addtime { get; set; }
        /// <summary>
        /// blog_delete
        /// </summary>
        public int blog_delete { get; set; }
        /// <summary>
        /// blog_tags
        /// </summary>
        public string blog_tags { get; set; }
        /// <summary>
        /// blog_cate
        /// </summary>
        public string blog_cate { get; set; }

        /// <summary>
        /// 0表示草稿1表示发布
        /// </summary>
        public int blog_type { get; set; }

        public string mem_name { get; set; }

        /// <summary>
        /// 字符日期
        /// </summary>
        public string blog_strtime {
            get {
                int year = this.blog_addtime.Year;
                int month = this.blog_addtime.Month;
                int day= this.blog_addtime.Day;
                string strmoth = "";
                switch (month)
                {
                    case 1:
                        strmoth = "一月";
                        break;
                    case 2:
                        strmoth = "二月";
                        break;
                    case 3:
                        strmoth = "三月";
                        break;
                    case 4:
                        strmoth = "四月";
                        break;
                    case 5:
                        strmoth = "五月";
                        break;
                    case 6:
                        strmoth = "六月";
                        break;
                    case 7:
                        strmoth = "七月";
                        break;
                    case 8:
                        strmoth = "八月";
                        break;
                    case 9:
                        strmoth = "九月";
                        break;
                    case 10:
                        strmoth = "十月";
                        break;
                    case 11:
                        strmoth = "十一月";
                        break;
                    case 12:
                        strmoth = "十二月";
                        break;
                }
                return strmoth+" "+day+", "+year;
            }
        }
    }
}
